package team.seekers.catering.third.controller.oss;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.web.multipart.MultipartFile;
import team.seekers.catering.common.result.R;
import team.seekers.catering.third.service.OssService;


@RestController
@RequestMapping("/oss")
public class OssController {
    @Autowired
    private OssService ossService;
    //图片
    @PostMapping("")
    public R uploadOssFile(MultipartFile file){
        String url = ossService.uploadFileAvatar(file);
        System.out.println(url);
        return R.success().data("url",url);
    }
}
